- cashes = Cash.all
- if cashes.any?
  :ruby
    stopped_on = Time.zone.today
    started_on = (stopped_on - 2.year).beginning_of_month
    if year = FinancialYear.first_of_all and year.started_on > started_on
      started_on = year.started_on
    end

    series = []
    date = started_on
    periods = {}
    while date < stopped_on
      periods[date.l(format: "%b %Y")] = date..(date.end_of_month)
      date = date + 1.month
    end

    cashes.each do |cash|
      data = periods.values.map do |period|
        cash.balance(period.end).to_f
      end
      series << {name: cash.name, data: data }
    end

  = spline_highcharts(series, legend: { align: 'center', vertical_align: 'bottom', border_width: 0 }, x_axis: { title: {text: :months.tl}, categories: periods.keys}, y_axis: {title: {text: :amounts_in_currency.tl(currency: Preference[:currency])}})
- else
  = no_data
